home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
The World of Computer Software.iso
/
porttool.zoo
/
date.man
< prev
next >
Wrap
Text File
|
1992-12-03
|
3KB
|
67 lines
NNAAMMEE
date - display or set system date and time
SSYYNNOOPPSSIISS
ddaattee [ -h ] [ -u ] [ _m_m_d_d_h_h_m_m[_y_y] ] [ +_f_o_r_m_a_t ]
DDEESSCCRRIIPPTTIIOONN
If no argument is given, or if the argument begins with +, ddaattee
displays the current date and time. Otherwise, the current date
and time is set.
When setting the date, the first _m_m is the month number; _d_d is the
day number in the month; _h_h is the hour number (given in the 24
hour system); the second _m_m is the minute number; _y_y is the last 2
digits of the year number and is optional. The current year is the
default if no year is mentioned.
If the argument begins with ++, the output of ddaattee is under the
control of the user. The format for the output is similar to that
of the first argument to printf(3S). All output fields are of
fixed size (zero padded if necessary). Each field descriptor is
preceded by %% and will be replaced in the output by its
corresponding value. A single %% is displayed with %%%%. All other
characters are copied to the output without change. The string is
always terminated with a new-line character.
Field Descriptors:
n insert a new-line character
t insert a tab character
m month of year - 01 to 12
d day of month - 01 to 31
y last 2 digits of year - 00 to 99
Y all 4 digits of year
D date as mm/dd/yy
H hour - 00 to 23
M minute - 00 to 59
S second - 00 to 59
T time as HH:MM:SS
j day of year - 001 to 366
w day of week - Sunday = 0
a abbreviated weekday - Sun to Sat
h abbreviated month - Jan to Dec
r time in AM/PM notation
z current timezone
OOPPTTIIOONNSS
--hh Display a short help message.
--uu Display the date in GMT (universal time). This option makes
sense only if the TZ environment variable is set.
EEXXAAMMPPLLEESS
date 10090842
Would set the date to October 9, 8:42 AM.
If the year were 1992, and the date was set as above,
date "+DATE: %m/%d/%y%nTIME: %H:%M:%S"
would generate as output:
DATE: 10/09/92
TIME: 08:42:00
CCooppyyrriigghhtt ((cc)) 11999922 FFrraannkk EE.. WWhhaalleeyy AAllll rriigghhttss rreesseerrvveedd